package com.yaDuo.common.base

import android.os.Bundle
import androidx.viewbinding.ViewBinding
import com.yaDuo.common.util.VBUtil

open class BaseVBActivity<VB : ViewBinding> : BaseActivity() {

    protected lateinit var vb: VB

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        loadVB()
    }

    private fun loadVB() {
        vb = VBUtil.createViewBindingFromGenericSuperclass(javaClass, layoutInflater)
        setContentView(vb.root)
    }
}